package com.kang.c0c.parser;

/**
 * An interface that defines codes for C0 source tokens returned from lexical analysis.
 * Tokens中用整数定义了各类不同描述c0文法语言源程序中所出现的记号
 *
 * @author kang
 *
 * Feb 5, 2009
 */

public interface Tokens {
    public static final int EOF = 0;	//End Of File
    public static final int ERROR = EOF + 1;	//ERROR
    public static final int IDENTIFIER = ERROR + 1;	//IDENTIFIER
    public static final int NUM = IDENTIFIER + 1; //number
    public static final int STRING = NUM + 1; //string

    public static final int CONST =  STRING + 1;	//const
    public static final int INT = CONST + 1;	//int
    public static final int IF = INT + 1;	//if
    public static final int ELSE = IF + 1;	//else
    public static final int WHILE = ELSE + 1;	//while
    public static final int VOID = WHILE + 1;	//void
    public static final int MAIN = VOID + 1;	//main
    public static final int SCANF = MAIN + 1;	//scanf
    public static final int PRINTF = SCANF + 1;	//printf
    public static final int RETURN = PRINTF + 1;	//return
    
    public static final int PLUS = RETURN + 1;	//+
    public static final int SUB = PLUS + 1;	//-
    public static final int STAR = SUB + 1;	//*
    public static final int SLASH = STAR + 1;	///
    public static final int EQ = SLASH + 1;	//=
    public static final int GT = EQ + 1;	//>
    public static final int LT = GT + 1;	//<
    public static final int EQEQ = LT + 1;	//==
    public static final int LTEQ = EQEQ + 1;	//<=
    public static final int GTEQ = LTEQ + 1;	//>=
    public static final int BANGEQ = GTEQ + 1;	//!=
    
    public static final int LPAREN = BANGEQ + 1;	//(
    public static final int RPAREN = LPAREN + 1;	//)
    public static final int LBRACKET = RPAREN + 1;	//{
    public static final int RBRACKET = LBRACKET + 1;	//}
    public static final int SEMI = RBRACKET + 1;	//;
    public static final int COMMA = SEMI + 1;	//,
    
    public static final int TokenCount = COMMA + 1;
}
